package com.renting.modules.sys.service;

import com.renting.modules.sys.dao.RoleDao;
import com.renting.modules.sys.entity.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/5/9.
 */
@Service
public class RoleService {

    @Autowired
    RoleDao roleDao;


    public List<Role> getRoles() {
        List<Role> list = new ArrayList<>();
        Iterable<Role> roles = roleDao.findAll();
        roles.forEach(role -> {
            list.add(role);
        });
        return list;
    }

}
